home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / irsim-ca.2 / irsim-ca / irsim-cap-9.2 / src / ana11 / base.c < prev    next >
C/C++ Source or Header  |  1993-01-15  |  2KB  |  76 lines

  1. /*
  2.  *     ********************************************************************* 
  3.  *     * Copyright (C) 1988, 1990 Stanford University.                     * 
  4.  *     * Permission to use, copy, modify, and distribute this              * 
  5.  *     * software and its documentation for any purpose and without        * 
  6.  *     * fee is hereby granted, provided that the above copyright          * 
  7.  *     * notice appear in all copies.  Stanford University                 * 
  8.  *     * makes no representations about the suitability of this            * 
  9.  *     * software for any purpose.  It is provided "as is" without         * 
  10.  *     * express or implied warranty.  Export of this software outside     * 
  11.  *     * of the United States of America may require an export license.    * 
  12.  *     *********************************************************************
  13.  */
  14.  
  15. #include "ana.h"
  16. #include "ana_glob.h"
  17. #include "graphics.h"
  18.  
  19.  
  20. public void ChangeBase( base )
  21.   char  *base;
  22.   {
  23.     int    change;
  24.     short  bdigits;
  25.  
  26.     if( not selectedTrace )
  27.       {
  28.     PRINT( "\nSelect a trace first!" );
  29.     XBell( display, 0 );
  30.     return;
  31.       }
  32.  
  33.     switch( *base )
  34.       {
  35.     case 'b' :
  36.         bdigits = 1;
  37.         break;
  38.     case 'o' :
  39.         bdigits = 3;
  40.         break;
  41.     case 'h' :
  42.         bdigits = 4;
  43.         break;
  44.       }
  45.  
  46.     if( IsVector( selectedTrace ) and selectedTrace->bdigit != bdigits )
  47.       {
  48.     selectedTrace->bdigit = bdigits;
  49.     change = WindowChanges();
  50.     if( change & RESIZED )
  51.         return;        /* will get ExposeWindow event later */
  52.  
  53.     if( change & WIDTH_CHANGE )    /* reshape the trace window */
  54.       {
  55.         DrawScrollBar( FALSE );
  56.         RedrawTimes();
  57.         DrawCursVal( cursorBox );
  58.         DrawTraces( tims.start, tims.end );
  59.       }
  60.     else
  61.       {
  62.         BBox  rb;
  63.  
  64.         rb.top = selectedTrace->top;
  65.         rb.bot = selectedTrace->bot;
  66.         rb.left = cursorBox.left;
  67.         rb.right = cursorBox.right;
  68.         DrawCursVal( rb );
  69.         rb.left = traceBox.left;
  70.         rb.right = traceBox.right;
  71.         RedrawTraces( &rb );        /* just redraw this trace */
  72.       }
  73.     
  74.       }
  75.   }
  76.